//旋转字符串,判断相等不相等
public class Test3 {
    public static void main(String[] args) {

        String strB="cdeab";

        String strA ="abcde";

        boolean res = check(strA,strB);
        System.out.println(res);
    }
    //旋转字符串
    public static String rotate(String str){
        /*如果修改字符串,两个办法
        1.用subString截取
        2.把字符串变成字符数组,调整后在变为字符串
                */
       char first =  str.charAt(0);
       String end = str.substring(1);
       return end+first;
    }
    public static boolean check(String strA,String strB){
        for(int i = 0;i<strA.length();i++){
            strA = rotate(strA);
            if(strA.equals(strB)){
                return true;
            }
        }
        return false;
    }
}
